package com.zlm.user.emp.controller;

import com.zlm.common.base.BaseController;
import com.zlm.common.constants.CodeConstants;
import com.zlm.common.dto.JsonResultDto;
import com.zlm.user.emp.service.SysUnderlingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 人才-controller
 * @Author: duyufu
 * @Date: 2019/5/5 16:57
 */
@RestController
@RequestMapping(value = "/underling")
public class SysUnderlingController extends BaseController {

    @Autowired
    private SysUnderlingService sysUnderlingService;

    /**
     * 添加/删除职业顾问
     * @param operationCode
     * @param partId
     * @param empId
     * @return
     */
    @GetMapping("/editLocalPartner")
    public JsonResultDto editLocalPartner(Integer operationCode,Integer partId,Integer empId) {
        try {
            String result = sysUnderlingService.editLocalPartner(operationCode,partId,empId);
            if (CodeConstants.CODE_SUCCESS.equals(result)) {
                return success();
            }else {
                return fail(result);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return fail(e.getMessage());
        }

    }

}
